package com.ihr360.shared.basicstaffinfo.service;

import com.ihr360.commons.vo.PageData;
import com.ihr360.entity.BasicStaffInfoEntity;
import com.ihr360.request.BasicStaffInfoReq;
import com.ihr360.shared.basicstaffinfo.dto.SyncedBasicStaffInfo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;

import java.util.List;

/**
 * @author Stone.Shi
 * @description
 * @date 2018-03-07 10:33:03.
 */
public interface BasicStaffInfoService {

    /**
     * 获取公司在职的总人数
     *
     * @param companyId
     * @param staffIds
     * @return
     */
    int getInServiceStaffCount(String companyId, List<String> staffIds);

    /**
     * 分页获取 id不在指定范围内的员工数据
     *
     * @param companyId
     * @param staffIds
     * @param pageable
     * @return
     */
    PageData<BasicStaffInfoEntity> getStaffsExclude(String companyId, List<String> staffIds,
                                                    BasicStaffInfoReq req, Pageable pageable);

    /**
     * 分页获取员工数据
     *
     * @param companyId
     * @param pageable
     * @return
     */
    PageData<BasicStaffInfoEntity> getStaffsInclude(String companyId, List<String> staffIds, BasicStaffInfoReq req, Pageable pageable);

    /**
     * 分页获取 id在指定范围内的员工数据
     *
     * @param companyId
     * @param staffIds
     * @param specification
     * @param pageable
     * @return
     */
    Page<BasicStaffInfoEntity> getStaffsInclude(String companyId, List<String> staffIds,
                                                Specification<SyncedBasicStaffInfo> specification, Pageable pageable);

    /**
     * 分页获取 id不在指定范围内的员工数据
     *
     * @param companyId
     * @param staffIds
     * @param specification
     * @param pageable
     * @return
     */

    Page<BasicStaffInfoEntity> getStaffsExclude(String companyId, List<String> staffIds,
                                                Specification<SyncedBasicStaffInfo> specification, Pageable pageable);

    /**
     * 按照StaffId获取员工列表
     *
     * @param companyId
     * @param staffIdList
     * @return
     */
    List<BasicStaffInfoEntity> getStaffList(String companyId, List<String> staffIdList);

    /**
     * 获取指定条件下公司员工
     *
     * @param companyId
     * @param specification
     * @return
     */
    List<BasicStaffInfoEntity> getStaffsIncludeNoPage(String companyId, Specification<SyncedBasicStaffInfo> specification);
}
